/* 导入主题化样式 */
@import './theme.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', sans-serif;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dashboard {
  width: 100vw;
  height: 100vh;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  grid-template-rows: 60px calc(100vh - 100px);
  row-gap: 20px;
}

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-primary);
  border-radius: 10px;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  flex: 1;
  transition: all 0.3s ease;
}

.panel-title {
  font-size: 18px;
  margin-bottom: 15px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background-color: var(--panel-bg);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-primary);
  z-index: 100;
}

.panel-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: linear-gradient(to bottom, #00d4ff, #0066ff);
  margin-right: 10px;
  border-radius: 2px;
}

.chart-container {
  flex: 1;
  width: 100%;
  /* min-height: 500px; */
  /* height: calc(100% - 40px); */
  flex-basis: 200px;
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.status-connected {
  background: rgba(0, 255, 0, 0.2);
  color: #00ff00;
}

.status-disconnected {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}

.tabs {
  display: flex;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(0, 149, 255, 0.3);
}

.tab {
  padding: 8px 15px;
  cursor: pointer;
  margin-right: 5px;
  border-radius: 5px 5px 0 0;
  transition: all 0.3s;
}

.tab.active {
  background: rgba(0, 149, 255, 0.3);
  color: #00d4ff;
}

.tab:hover:not(.active) {
  background: rgba(0, 149, 255, 0.1);
}

.stats-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: rgba(0, 100, 200, 0.2);
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid rgba(0, 149, 255, 0.2);
}

.stats-value {
  font-size: 28px;
  font-weight: bold;
  margin: 5px 0;
  background: linear-gradient(to right, #00d4ff, #0066ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.blink {
  animation: blink 2s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.scroll-container {
  overflow-y: auto;
  /* height: calc(100% - 40px); */
}

/* 酷炫科技风格滚动条 - 表格容器专用 */
::-webkit-scrollbar {
  width: 4px;
  background: rgba(6, 30, 93, 0.3);
  border-radius: 4px;
  cursor: pointer;
}

::-webkit-scrollbar-track {
  background: linear-gradient(
    180deg,
    rgba(6, 30, 93, 0.2) 0%,
    rgba(16, 66, 126, 0.3) 50%,
    rgba(6, 30, 93, 0.2) 100%
  );
  border-radius: 4px;
  box-shadow: inset 0 0 3px rgba(0, 149, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    rgba(0, 212, 255, 0.8) 0%,
    rgba(0, 149, 255, 0.9) 50%,
    rgba(0, 102, 255, 0.8) 100%
  );
  border-radius: 4px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow:
    0 0 6px rgba(0, 212, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    rgba(0, 212, 255, 1) 0%,
    rgba(0, 149, 255, 1) 50%,
    rgba(0, 102, 255, 1) 100%
  );
  box-shadow:
    0 0 12px rgba(0, 212, 255, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: scaleX(1.2);
}

::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    rgba(0, 255, 255, 0.9) 0%,
    rgba(0, 212, 255, 1) 50%,
    rgba(0, 149, 255, 0.9) 100%
  );
  box-shadow:
    0 0 15px rgba(0, 255, 255, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
